<?php

use think\migration\Seeder;

class ChapterTableSeeder extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $rows = [];
        for($i = 1; $i <= 10; $i ++){
            for($j = 1; $j<=5; $j++){
             $rows[] = [
                    'user_id' => 1,
                    'week_id' => $i,
                    'title' => $j . '-----创建和浏览网页',
                    'is_lock' => mt_rand(0,1),
                    'create_time' => date('Y-m-d H:i:s'),
                    'update_time' => date('Y-m-d H:i:s')
                ];
            }
        }

        $this->table('chapter')->insert($rows)->save();
    }
}